package com.cyou.demo.service.impl;

import com.cyou.demo.mapper.PersonMapper;
import com.cyou.demo.model.Person;
import com.cyou.demo.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**	Created by chenzhuo_m on 2018/3/7. */

@Service
public class PersonServiceImpl implements PersonService {

	@Autowired
	private PersonMapper personMapper ;

	@Override
	public Person selectUser(Long id) {
		Long beforeTime = System.currentTimeMillis() ;
		Person person = personMapper.selectPerson(id);
		Long afterTime = System.currentTimeMillis() ;
		Long selectTime = afterTime - beforeTime ;
		System.out.println(" @@  selectTime : " + selectTime);
		return person ;
	}

	@Override
	public Person getUserInfo(Long userId) {
		Long beforeTime = System.currentTimeMillis() ;
		Person person = personMapper.getUserInfo(userId);
		Long afterTime = System.currentTimeMillis() ;
		Long selectTime = afterTime - beforeTime ;
		System.out.println(" @@  getUserInfo : " + selectTime);
		return person ;
	}

	@Override
	public boolean test() {
		return false;
	}
}
